import { ReactText } from 'react';

// orgData from netword
export interface IResOrgPerson {
  name: string;
  userId: string;
  type: number;
}

export interface IResOrgTreeItem {
  id: string;
  parentId?: string;
  parentKey?: string;
  children?: IResOrgTreeItem[];
  orgName: string;
  type?: number;
  sort: number;
  persons: any[];
}
// orgData --- end

export interface IOrgTreeItem {
  parentKey?: string;
  key: string;
  parentId?: string;
  children?: IOrgTreeItem[];
  title: string;
  type?: number;
  sort?: number;
  icon?: string;
  persons?: any[];
  id?: any;
  name?: string;
  userOrgType?: any;
}
// orgData --- end

export interface IOrgTreeCheckedItem extends IOrgTreeItem {
  extra?: any;
}

export interface FlattenTree {
  [index: string]: IOrgTreeCheckedItem;
}

export interface IOrgTreeProps {
  treeData: IOrgTreeItem[];
  checkedKeys: ReactText[];
  expandKeys: ReactText[];
  flattenTree?: FlattenTree;
  onlyUser?: boolean;
  mode?: string;
  onCheck: (checkedKeys: string[], checkedItems: IOrgTreeCheckedItem[]) => void;
}
